<script>
export default {
  name: "index",
  data() {
    return {
      videoList: [

      ]
    }
  },
  onLoad() {
    this.$api.getPracticeList().then(res => {
      this.videoList = res
      console.log(res)
    })
  },
  methods: {
    navBack() {
      this.$u.route({
        type: 'navigateBack'
      })
    },
    routeTo(item) {
      if (item) {
        this.$u.route({
          type: 'navigateTo',
          url: '/pages/LawPractice/detail?id=' + item.id
        })
      }
    }
  }
}
</script>

<template>
<div class="LawPractice">
  <div class="custom-home-header">
    <div class="title">EasyLaw</div>
    <div class="sub-title">The elbsest ingel ald far ntemsrtlens students</div>
  </div>
  <div class="back-top"  @click="navBack">
    <u-icon name="arrow-left" size="28"></u-icon>
    <span class="back-name">LawPractice</span>
  </div>
  <div class="video-list">
    <u-row gutter="20" style="width: 100%">
      <u-col span="6" v-for="item in videoList" @click="routeTo(item)">
        <div class="video-item" >
          <img :src="item.image" alt="">
          <div class="video-name">{{ item.name }}</div>
        </div>
      </u-col>
    </u-row>

  </div>
</div>
</template>

<style scoped lang="scss">
.LawPractice {
  .custom-home-header {
    height: 100rpx;
    background-color: #409eff;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    .title {
      font-size: 36rpx;
      line-height: 100rpx;
      padding-left: 50rpx;
    }
    .sub-title {
      font-size: 24rpx;
      color: #a6a2a2;
      margin-left: 20rpx;
      padding-top: 50rpx;
    }
  }

  .back-top {
    display: flex;
    align-items: center;
    padding: 10rpx 0;
    margin-bottom: 40rpx;
  }
  .back-name {
    margin-left: 20rpx;
    font-size: 28rpx;
    color: #333333;
  }
  .video-list {
    display: flex;
    flex-wrap: wrap;
  }
  .video-item{
    text-align: center;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    .video-name{
      line-height: 36rpx;
    }
    img{
      width: 100%;
      height: 180rpx;
    }
  }
}
</style>
